package main

import (
	"fmt"
	"github.com/kataras/iris/v12"
)

func (app *application) serve() {
	server := iris.New()

	microserviceApi := server.Party("/microservice")
	{
		microserviceApi.Post("/rate", app.insertSummary)
		microserviceApi.Get("/scores", app.getScores)
		microserviceApi.Get("/query-scores", app.queryScores)
	}

	courseApi := server.Party("/course")
	{
		courseApi.Post("/rate", app.insertSummary)
		courseApi.Get("/query-scores", app.queryCourse)
	}
	_ = server.Listen(fmt.Sprintf(":%d", 8450))
}
